/**
 * 
 * @param {HTMLCanvasElement} canvas 
 * @param {string} filename 
 */
export  function canvasToImage(canvas,filename='canvas') {
  canvas.toBlob((b)=>{
    const a = document.createElement('a')
    a.href = URL.createObjectURL(b)
    a.download = filename
    a.click()
  },'image/png',1)
}